<template>
  <div>
    <headers></headers>

    <div class="main">
      <component :is="comname"></component>
    </div>
    <mytabbar :arr="tabList" @changebar="changefn"></mytabbar>
  </div>
</template>

<script>
//头部和底部
import headers from "./components/myheader";
import mytabbar from "./components/mytabbar";
//引入页面
import mygoodslist from "./views/mygoodslist";
import mysearch from "./views/myserch";
import userinfo from "./views/userinfo";
export default {
  data() {
    return {
      comname: "mygoodslist",
      tabList: [
        {
          icon: "icon-shangpinliebiao",
          text: "商品列表",
          name: "mygoodslist",
        },
        {
          icon: "icon-sousuo",
          text: "商品搜索",
          name: "mysearch",
        },
        {
          icon: "icon-user",
          text: "我的信息",
          name: "userinfo",
        },
      ],
    };
  },
  methods: {
    changefn(index) {
      this.comname = this.tabList[index].name;
    },
  },
  components: {
    headers,
    mytabbar,
    mygoodslist,
    mysearch,
    userinfo,
  },
};
</script>

<style scoped>
.main {
  padding: 45px 0 50px 0;
}
</style>